<template>
  <el-dialog :visible.sync="value" :before-close="() => $emit('input', false)">
    <template slot="title">
      代理上分设置
    </template>
    <el-form :model="form"  ref="refForm" label-width="180px">
      <el-form-item label="下发状态：" prop="status">
        <el-col :span="16">
          <el-select v-model="form.status" style="width: 100%;">
            <el-option label="开启" :value="1"></el-option>
            <el-option label="关闭" :value="0"></el-option>
          </el-select>
        </el-col>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="doSave({action: 'saveForm'})" :loading="loading">确认</el-button>
      <el-button @click="cancel">取 消</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import {getMemberSet} from '@/services/api/member';
  import {form} from '@/build';
  export default {
    name: "configuration-lines-dialog",
    props: ['value', 'rowData'],
    mixins: [form],
    data() {
      return {
        form: {
          status: this.rowData.proxyStatus,
          proxyId:this.rowData.id
        },
      }
    },
    methods: {
      cancel() {
        this.$emit('input', false);
      }
    },
    mounted() {
      this.bindSave(getMemberSet, 'saveForm','form', {
        beforeSend: (data) => {
          const {proxyId,status} = data;
          return {proxyId,status}
        },
        afterSuccess: () => {
          this.$emit('input', false);
          this.$parent.gridSearch()
        }
      });
    }
  }
</script>

<style scoped>

</style>
 是
